<template>
    <div>
        <h1>我的工单</h1>

        <p v-for="i,j in orderlist" :key="j">
            <span v-for="i,j in i.name" :key="j">
                {{j+": "}} ------- {{i}} <br>
            </span>

            <!-- <a-button type="primary" @click="btn(i.id)">查看审批进度</a-button> -->
            <span v-if="i.start<3">
                <a-steps :current="i.start">
                    <a-step>
                    <!-- <span slot="title">Finished</span> -->
                    <template slot="title">
                        {{i.name['审批人1']}}
                    </template>
                    <span slot="description"></span>
                    </a-step>
                    <a-step>
                        <template slot="title">
                            {{i.name['审批人2']}}
                        </template>
                        <span slot="description"></span>
                    </a-step>
                    <a-step title="审核通过" description="" />
                </a-steps>
            </span>
            <span v-else style="color:red">
                审批未通过
            </span>

        </p>
    </div>
</template>

<script>
import Axios from 'axios'
export default {
    data() {
        return {
            // 获取到状态保持的用户ID
            uid:sessionStorage.getItem("uid"),
            orderlist:[],
        }
    },
    methods: {
        
    },
    created() {
        Axios({
            url:"http://localhost:8000/myworkorder/?uid="+this.uid,
            method:"GET",
        }).then(res=>{
            console.log(res.data)
            this.orderlist = res.data
        })
    },
}
</script>

<style>

</style>